package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.SharedLeadDaoImpl;
import com.asset.salesforce.domain.SharedLead;

@Service
@Transactional(readOnly=true)
public class SharedLeadService {

	@Autowired
	private SharedLeadDaoImpl sharedLeadDaoImpl;
	
	public SharedLead getById(Integer id) {
		return sharedLeadDaoImpl.getById(id, new SharedLead());
	}
	
	@Transactional(readOnly=false)
	public void add(SharedLead sharedLead) {
		sharedLeadDaoImpl.add(sharedLead);
	}
	
	@Transactional(readOnly=false)
	public void saveOrupdate(SharedLead sharedLead){
		sharedLeadDaoImpl.saveOrupdate(sharedLead);
	}
	
	@Transactional(readOnly=false)
	public void delete(SharedLead sharedLead) {
		sharedLeadDaoImpl.delete(sharedLead);
	}
	
	public List<SharedLead> getAll() {
		return sharedLeadDaoImpl.getAll(new SharedLead());
	}
	
	public Integer getAllSize() {
		return sharedLeadDaoImpl.getAllSize(new SharedLead());
	}
	
	public List<SharedLead>getAllSharedByEmployee(Integer id){
		return sharedLeadDaoImpl.getAllSharedByEmployee(id);
	}
}
